<?php
include_once APPLICATION_DIR . "/application/model/BANNER_MODULE.php";

class Banner_Module extends DataObjects_BANNER_MODULE
{
	public function arrayBanner($id_banner)
	{
		$result = array();

		$this->ID_BANNER = $id_banner;
		$this->find();
		while ($this->fetch()) {
			$result[] = $this->ID_MODULE;
		}
		return $result;
	}

	public function deleteBanner($id_banner)
	{
		$this->ID_BANNER = $id_banner;
		unset($this->ID_MODULE);
		$this->delete();
	}

	public function insertBanner($id_banner, $arr)
	{
		if (is_array($arr))
		{
			$this->ID_BANNER = $id_banner;

			foreach ($arr as $id)
			{
				$this->ID_MODULE = $id;
				$this->insert();
			}
		}
	}
}
?>